var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var ResKeeper = require("AA_ResKeeper");
var AutoImagZiTi = require("AA_AutoImagZiTi");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_MosterXueTiao = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.xue2 = null;
    t.xue1 = null;
    t.xueLb = null;
    t.xueScript = null;
    t.maxValue = 0;
    t.nowvalue = 0;
    t.nowofftime = 0;
    t.tw = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.initXue = function (e) {
    var t = this.node.getChildByName("xuetiaolb");
    if (t) {
      this.xueScript = t.getComponent(AutoImagZiTi.default);
      this.xueLb = t.getComponent(cc.Label);
    }
    this.maxValue = e;
    this.nowvalue = e;
    this.xue1.fillStart = 1;
    this.xue2.fillStart = 1;
    var o = (this.nowvalue + "").split(".");
    this.xueLb && (this.xueLb.string = o[0]);
    this.xueScript && this.xueScript.setValue(o[0]);
  };
  _creator.prototype.subXue = function (e) {
    this.nowvalue -= e;
    this.nowvalue < 0 && (this.nowvalue = 0);
    var t = this.nowvalue / this.maxValue;
    t < 0 && (t = 0);
    this.xue2.fillStart = t;
    this.tw && this.tw.stop();
    this.tw = cc.tween(this.xue1).delay(.1).to(.2, {
      fillStart: t
    }).start();
    var o = (this.nowvalue + "").split(".");
    this.xueLb && (this.xueLb.string = o[0]);
    this.xueScript && this.xueScript.setValue(o[0]);
  };
  __decorate([_property(cc.Sprite)], _creator.prototype, "xue2", undefined);
  __decorate([_property(cc.Sprite)], _creator.prototype, "xue1", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_MosterXueTiao;